Show:

ia.MapController Class

Module: ia

Used to control chart navigation.

Constructor

ia.MapController

(
  • m
)

Parameters:

Methods

centerOnCoords

(
  • px
  • py
)

Centers the view on a pair of coordinates.

Parameters:

  • px Number

    The x-coord (data units).

  • py Number

    The y-coord (data units).

centerOnCursor

()

Centers the view on the cursor position.

centerOnPoint

(
  • p
)

Centers the view on a point.

Parameters:

changeBBox

(
  • dXMin
  • dYMin
  • dXMax
  • dYMax
)

Changes the bounding box using the given distances.

Parameters:

  • dXMin Number

    The change in the xMin (data units).

  • dYMin Number

    The change in the yMin (data units).

  • dXMax Number

    The change in the xMax (data units).

  • dYMax Number

    The change in the yMax (data units).

pan

(
  • direction
  • ratio
)

Pans the given direction and distance.

Parameters:

  • direction Number

    The direction in degrees. Valid values are >=0 and <=360.

  • ratio Number

    To calculate the distance moved, ratio is multiplied by the bBox width or height (depending on the direction of the pan).

    The bBox is then shifted by the calculated distance.

    Valid values are > 0.

panDistance

(
  • direction
  • distance
)

Pans the given direction and distance.

Parameters:

  • direction Number

    The direction in degrees. Valid values are >=0 and <=360.

  • distance Number

    The distance (data units).

panE

()

Pans East.

panN

()

Pans North.

panNE

()

Pans North-East.

panNW

()

Pans North-West.

panS

()

Pans South.

panSE

()

Pans South-East.

panSW

()

Pans South-West.

panW

()

Pans West.

resetBBox

(
  • bx
  • by
  • bw
  • bh
)

Zooms to a bounding box as defined by the following parameters. This is a utility function so that bounding boxes can be dealt with in terms of their x, y, width and height;

Parameters:

  • bx Number

    The x position of the bBox.

  • by Number

    The y position of the bBox.

  • bw Number

    The width of the bBox.

  • bh Number

    The height of the bBox.

translate

(
  • dx
  • dy
)

Moves the view by the given distance.

Parameters:

  • dx Number

    The distance in the x direction (data units).

  • dy Number

    The distance in the y direction (data units).

zoomFull

()

Zooms to full extents as defined by the default bBox.

zoomIn

()

Zooms in around the center of the view.

zoomInOnCursor

()

Zooms in around the cursor position.

zoomOnCenter

(
  • ratio
)

Zooms around the center of the view.

Parameters:

  • ratio Number

    To calculate the distance zoomed, the bBox width and height are multiplied by the ratio.

    Valid values are > 0.

    Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.

zoomOnCoords

(
  • px
  • py
  • ratio
)

Zooms in around a pair of coordinates.

Parameters:

  • px Number

    The x-coord (data units).

  • py Number

    The y-coord (data units).

  • ratio Number

    To calculate the distance zoomed, the bBox width and height are multiplied by the ratio.

    Valid values are > 0.

    Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.

zoomOnCursor

(
  • ratio
)

Zooms around the cursor position by the given ratio.

Parameters:

  • ratio Number

    To calculate the distance zoomed, the bBox width and height are multiplied by the ratio.

    Valid values are > 0.

    Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.

zoomOnPoint

(
  • px
  • ratio
)

Zooms in around a point.

Parameters:

  • px ia.Point

    The point (data units).

  • ratio Number

    To calculate the distance zoomed, the bBox width and height are multiplied by the ratio.

    Valid values are > 0.

    Values > 1 will cause the view to zoom out. values < 1 will cause the view to zoom in.

zoomOut

()

Zooms out around the center of the view.

zoomOutOnCursor

()

Zooms out around the cursor position.

zoomToBBox

(
  • bb
)

Zooms to a bounding box.

Parameters:

zoomToExtent

(
  • extent
)

Zooms to an extent around the center of the view.

Parameters:

  • extent Object

    The extent to zoom to (data units).

zoomToPointExtent

(
  • p1
  • p2
)

Zooms to an extent as defined by two points.

Parameters:

zoomToRect

(
  • rect
)

Zooms to a rectangle if the rectangle is greater than 5*5 pixels.

Parameters:

Properties

defaultBBox

ia.BoundingBox

A default BoundingBox for the view.